﻿using System;
using System.Xml.Serialization;
using System.Collections.ObjectModel;
using System.Collections.Generic;

namespace Interscape.TwilioClient.Components
{
    /// <summary>
    /// The base class containing Paging information for list/collections of TwilioClient Components.
    /// </summary>
    /// <typeparam name="T">The TwilioClient type for the List.</typeparam>
    [Serializable]
    public class PagedList<T> : List<T>
    {

        /// <summary>
        /// A zero-based index of the page you are currently viewing.
        /// </summary>
        [XmlAttribute("page")]
        public int Page { get; set; }

        /// <summary>
        /// A 1-based count of the number of total pages in the List.
        /// </summary>
        [XmlAttribute("numpages")]
        public int PageCount { get; set; }

        /// <summary>
        /// A 1-based count of the number of Items in each Page.
        /// </summary>
        [XmlAttribute("pagesize")]
        public int PageSize { get; set; }

        /// <summary>
        /// A 0-based count of the total number of items in the potential resultset.
        /// </summary>
        [XmlAttribute("total")]
        public int ItemCount { get; set; }

        /// <summary>
        /// A zero-based index of the first object on this page, out of the total number of items in the potential resultset.
        /// </summary>
        [XmlAttribute("start")]
        public int StartIndex { get; set; }

        /// <summary>
        /// A zero-based index of the last object on this page, out of the total number of items in the potential resultset.
        /// </summary>
        [XmlAttribute("end")]
        public int EndIndex { get; set; }

    }
}
